<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>jQuery表单验证例子</title>

    <script type="text/javascript" src="js/jquery/jquery-1.7.min.js"></script>
    <script type="text/javascript" src="js/jquery.validate.js" ></script>
        </head>

  <body>
  <form id="dkla">
      <input type="text" name="ll" />
      <input type="submit" value="submit" id="sub">
      </form>
  <script language="javascript">
      $().ready(function() {
          $("#dkla").validate({
              rules:{
                  ll:{required: true,maxlength:5}
              }
          })
      })
      </script>
</body>
</html>